package com.ruoyi.system.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

public class ZlsLegendVo {

    @Data
    @ApiModel("ZlsLegendVo - LegendResult")
    public static class LegendResult {
        @ApiModelProperty("等级")
        private String level;
        @ApiModelProperty("上限")
        private String lower;
        @ApiModelProperty("上限")
        private String upper;
        @ApiModelProperty("单位")
        private String unit;
        @ApiModelProperty("颜色")
        private String color;
        @ApiModelProperty("指标")
        private String indicatrix;
    }

    @Data
    @ApiModel("ZlsLegendVo - HospitalResult")
    public static class HospitalResult {
        private Long deptId;
        @ApiModelProperty("名称")
        private String deptName;
        @ApiModelProperty("经度")
        private String lng;
        @ApiModelProperty("纬度")
        private String lat;
        @ApiModelProperty("dnt平均时间")
        private BigDecimal dntAvg;
        @ApiModelProperty("患者数量")
        private Long patientNum;
    }

    @Data
    @ApiModel("ZlsLegendVo - HospitalIndexResult")
    public static class HospitalIndexResult {
        private Long deptId;
        @ApiModelProperty("医院名称")
        private String hospitalName;
        @ApiModelProperty("经度")
        private String lat;
        @ApiModelProperty("纬度")
        private String lng;
        @ApiModelProperty("指标名称")
        private String indicatrix;
        @ApiModelProperty("指标值")
        private BigDecimal indicatrixValue;
    }

    @Data
    @ApiModel("AmsHomeVo - DrtList")
    public static class DrtList {
        @ApiModelProperty("急救ID")
        private Long firstAidId;
        @ApiModelProperty("CODE")
        private String code;
        @ApiModelProperty("答案")
        private String answer;
        @ApiModelProperty("时间")
        private Date time;
        @ApiModelProperty("")
        private String dateTime = "";
        @ApiModelProperty("创建时间")
        private Date createTime;
        @ApiModelProperty("发病时间")
        private Date fbsj;
        @ApiModelProperty("血管在通时间")
        private Date xgztsj;
        @ApiModelProperty("到院时间")
        private Date dysj;
        @ApiModelProperty("到达急诊时间")
        private Date ddzjsj;

        public Long getDrtTime() {
            if ((dysj != null || ddzjsj != null) && xgztsj != null) {
                return xgztsj.getTime() - (ddzjsj == null ? dysj.getTime(): ddzjsj.getTime());
            }
            return 0L;
        }
    }

}
